package cn.edu.jcu.kyle.gintama.OurUtil;

import cn.edu.jcu.kyle.gintama.Main;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.scene.layout.StackPane;
import javafx.scene.text.Text;
import javafx.scene.text.TextAlignment;
import javafx.stage.Stage;

import java.util.Objects;

public class AlertWindow {
    public static void getWindow(String _text) {    //弹出提示框
        Text text = new Text(_text);
        text.setTextAlignment(TextAlignment.CENTER);
        Stage stage = new Stage();
        StackPane stackPane = new StackPane();
        stackPane.getChildren().addAll(text);
        Scene scene = new Scene(stackPane, 200, 150);
        stage.setTitle("提示");
        stage.getIcons().add(new Image(Objects.requireNonNull(Main.class.getResource("img/warning.png")).toExternalForm()));
        stage.setScene(scene);
        stage.show();
    }
}
